<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="nature_value">
    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
</c:set>
<div class="t_bar">

    项目基本情况
</div>
<table class="t_css" id="basic_tab" width="100%" border="0" cellpadding="0" cellspacing="1">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />
    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>项目名称：</td>
        <td colspan="3">
            <input type="text" name="proposal/zh_title" id="zh_title" onchange="reqName()" style="width: 82%;" class="required" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title"/>" label="项目名称">
        </td>
    </tr>


    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>归口管理单位：</td>
        <td colspan="1">
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  id="recomend_org" showPattern="all" shieldPattern="0"
                      topCheckbox="false" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" style="width: 80%;" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
            <input type="hidden" name="proposal/recomend_org_name" style="width: 80%;" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
        <td align="right"><span class="color_red">*</span>申报日期：</td>
        <td colspan="1">
            <c:set var="submit_date">
                <x:out select="$xmlData/data/proposal/submit_date" />
            </c:set>
            <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
        </td>
    </tr>

    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>项目联系人姓名：</td>
        <td>


            <input type="text"  name="proposal/contact_psn_cname" class="required" maxlength="20" style="text-align: left;"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />" label="项目联系人姓名" >

        </td>
        <td align="right"><span class="color_red">*</span>联系人手机：</td>
        <td>
            <input type="text"  name="proposal/contact_psn_mobile" class="required mobile" style="text-align: left;"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_mobile"/>" label="联系人手机" onfocus="InitInput.setNumber(this,11,0,0);">
        </td>
    </tr>
    <tr class="li_2">
        <td align="right">项目负责人姓名：</td>
        <td>
            <span   name="proposal/fzr_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
        </td>
        <td align="right">负责人电子邮箱：</td>
        <td>
            <span  name="proposal/fzr_email"  ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
        </td>
    </tr>

    <tr class="li_1">
        <td align="right">项目负责人手机：</td>
        <td>
            <span name="proposal/fzr_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
        </td>
        <td align="right">负责人电话：</td>
        <td>
			<span  name="proposal/fzr_tel">
				<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
        </td>
    </tr>

    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>内设学院或机构<br/>（没有可填无）：</td>
        <td colspan="3">
            <input type="text"  name="proposal/built_institute" class="required" onchange="synchronizationAmount1()"  id="built_institute" style="text-align: left;width: 82%;" maxlength="30"
                   value="<x:out select="$xmlData/data/proposal/built_institute"/>" label="内设学院或机构" >
        </td>
    </tr>

    <c:if test="${fn:substring(nature_value,0,1) eq 'A'}">
        <tr class="li_1">
            <td align="right">企业类型
                （是否中小企业参考工信部联企业〔2011〕300号关于印发中小企业划型标准规定的通知 ）：</td>
            <td colspan="3" align="center">
                <input type="checkbox" name="enterprise_scale" id="isEnterpriseScale" value="中小企业" style="margin-left: 10%" onClick="initControlValue(this.id);removeDisabled();">中小企业
                （<input type="checkbox" name="technology_enterprise" id="technologyEnterprise" disabled="disabled" value="科技型中小企业" onClick="initControlValue(this.id);" >科技型中小企业）
                <input type="checkbox" name="enterprise_scale" id="noEnterpriseScale" value="民营企业" style="margin-left: 10%" onClick="initControlValue(this.id);">民营企业
                <input type="hidden" id="enterprise_scale_value" name="proposal/enterprise_scale_value"    value="<x:out select="$xmlData/data/proposal/enterprise_scale_value" />" label="企业类型">
                <input type="hidden" id="technology_enterprise_value" name="proposal/technology_enterprise_value" value="<x:out select="$xmlData/data/proposal/technology_enterprise_value" />">

                    <%--<cpt:checkbox key="is_or_no" name="proposal/small_medium_enterprise" repeatColumn="2" tagType="radio"></cpt:checkbox>
                        <input type="hidden" id="prp_date_value" name="proposal/small_medium_enterprise_value" class="required" label="是否中小企业" value="<x:out select="$xmlData/data/proposal/small_medium_enterprise_value" />">
                        <input type="hidden" name="proposal/small_medium_enterprise_name" value="<x:out select="$xmlData/data/proposal/small_medium_enterprise_name" />">--%>
            </td>
        </tr>
    </c:if>

    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>是否安徽省十大新兴产业：</td>
        <td colspan="3" align="center">
            <c:set var="emerging_enterprises_value"><x:out select="$xmlData/data/proposal/emerging_enterprises_value" /></c:set>
            <cpt:checkbox key="no_yes" name="emerging_enterprises"  width="100px"  repeatColumn="4" value="${emerging_enterprises_value }"  onClick="emerging_enterprises" tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="emerging_enterprises_value" name="proposal/emerging_enterprises_value" class="required" value="${emerging_enterprises_value}" label="是否安徽省十大新兴产业">
            <input type="hidden" name="proposal/emerging_enterprises_name" value="<x:out select="$xmlData/data/proposal/emerging_enterprises_name" />">

            <div id="emerging_industries_value_div" style="display: none">
                <c:set var="emerging_industries_value"><x:out select="$xmlData/data/proposal/emerging_industries_value" /></c:set>
                <cpt:checkbox key="emerging_industries" name="emerging_industries"  width="100px"  repeatColumn="4" value="${emerging_industries_value }" ></cpt:checkbox>
                <input type="hidden" id="emerging_industries_value" name="proposal/emerging_industries_value" class="" value="${emerging_industries_value}" label="是否安徽省十大新兴产业-->安徽省十大新兴产业">
                <input type="hidden" name="proposal/emerging_industries_name"  value="<x:out select="$xmlData/data/proposal/emerging_industries_name" />">
            </div>
        </td>
    </tr>

    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>是否产学研合作项目：</td>
        <td colspan="3" align="center">
            <c:set var="industry_university_value"><x:out select="$xmlData/data/proposal/industry_university_value" /></c:set>
            <cpt:checkbox key="no_yes" name="industry_university"  width="70px"  repeatColumn="4" value="${industry_university_value }"   tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="industry_university_value" name="proposal/industry_university_value" class="required" value="${industry_university_value}" label="是否产学研合作项目">
            <input type="hidden" name="proposal/industry_university_name" value="<x:out select="$xmlData/data/proposal/industry_university_name" />">
        </td>
    </tr>

    <c:if test="${fn:substring(nature_value,0,1) eq 'A'}">
        <tr class="li_2">
            <td align="right"><span class="color_red">*</span>是否规模以上工业企业：</td>
            <td colspan="3" align="center">
                <c:set var="industrial_enterprise_value"><x:out select="$xmlData/data/proposal/industrial_enterprise_value" /></c:set>
                <cpt:checkbox key="no_yes" name="industrial_enterprise"  width="70px"  repeatColumn="4" value="${industrial_enterprise_value }"  onClick="industrial_enterprise" tagType="radio" ></cpt:checkbox>
                <input type="hidden" id="industrial_enterprise_value" name="proposal/industrial_enterprise_value" class="required" value="${industrial_enterprise_value}" label="是否规模以上工业企业">
                <input type="hidden" name="proposal/industrial_enterprise_name" value="<x:out select="$xmlData/data/proposal/industrial_enterprise_name" />">
            </td>
        </tr>
        <input type="hidden" name="proposal/industrial_value" id="industrial_value" value="<x:out select="$xmlData/data/proposal/industrial_value" />">
    </c:if>




    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>合作形式：</td>
        <td>
            <c:set var="foreigncooperation_nature"><x:out select="$xmlData/data/proposal/foreigncooperation_nature" /></c:set>
            <cpt:checkbox key="foreigncooperation_nature" name="foreigncooperation_nature"  value="${foreigncooperation_nature }" width="80px;" repeatColumn="2" tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="foreigncooperation_nature_value" name="proposal/foreigncooperation_nature_value"  class="required"  value="<x:out select="$xmlData/data/proposal/foreigncooperation_nature_value" />" label="合作形式">
            <input type="hidden" name="proposal/foreigncooperation_nature_name" value="<x:out select="$xmlData/data/proposal/foreigncooperation_nature_name" />">
        </td>

        <td align="right"><span class="color_red">*</span>所属领域：</td>
        <td colspan="2">
            <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
            <c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
            <c:set var="researcharea_all_value"><x:out select="$xmlData/data/proposal/researcharea_all_value" /></c:set>
            <c:set var="researcharea">{'id':'<x:out select="$xmlData/data/proposal/researcharea_all_value" />','name':'<x:out select="$xmlData/data/proposal/researcharea_all_name" />'}</c:set>
            <c:if test="${empty researcharea_all_value }"><c:set var="researcharea">{'id':'<x:out select="$xmlData/data/proposal/researcharea_value" />','name':'<x:out select="$xmlData/data/proposal/researcharea_name" />'}</c:set></c:if>
            <cpt:tree key="researcharea1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${researcharea}"  label="所属领域"
                      id="researcharea" onlyChooseLeaf="true" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="localInitTreeValue" sqlParamVal="{grant_code:${sub},stat_year:${statYear }}"/>
            <input id="researcharea_value" type="hidden" name="proposal/researcharea_value" class="required" label="所属领域" value="<x:out select="$xmlData/data/proposal/researcharea_value" />"/>
            <input id="researcharea_name" type="hidden" name="proposal/researcharea_name"  value="<x:out select="$xmlData/data/proposal/researcharea_name" />"/>
            <input id="researcharea_all_name" type="hidden" name="proposal/researcharea_all_name"  value="<x:out select="$xmlData/data/proposal/researcharea_all_name" />"/>
            <input  type="hidden" id="researcharea_all_value" name="proposal/researcharea_all_value"  value="<x:out select="$xmlData/data/proposal/researcharea_all_value" />"/>


        </td>
    </tr>

    <%--<tr>
        <td align="right"><span class="color_red">*</span>项目开始日期：</td>
        <td>
            <c:set var="start_date">
                <x:out select="$xmlData/data/proposal/start_date" />
            </c:set>
            <cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className=" required date   dateCompare:end_date " label="项目开始日期"></cpt:date>
        </td>
        <td align="right"><span class="color_red">*</span>项目结束日期：</td>
        <td>
            <c:set var="end_date">
                <x:out select="$xmlData/data/proposal/end_date" />
            </c:set>
            <cpt:date id="end_date" name="proposal/end_date" value="${end_date}" className=" required date " label="项目结束日期"></cpt:date>
        </td>
    </tr>--%>
    <tr class="li_2">
        <td align="right">项目开始日期：</td>
        <td align="center">
            <span name="proposal/start_date"><x:out select="$xmlData/data/proposal/start_date" /></span>
            <%--<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date"/></c:set>
            <cpt:date id="start_date" name="proposal/start_date" label="项目开始日期" value="${start_date }" className=" required  date  "  ></cpt:date>--%>
        </td>
        <td align="right"><span class="color_red">*</span>项目结束日期：</td>
        <td>
            <%--<span name="proposal/end_date"><x:out select="$xmlData/data/proposal/end_date" /></span>--%>
            <c:set var="pro_end_date"><x:out select="$xmlData/data/proposal/end_date"/></c:set>
            <cpt:date id="end_date" name="proposal/end_date" label="项目结束日期" value="${param.pro_end_date }" className=" required  date dateCompareAfterE:end_date:start_date "></cpt:date>
        </td>
    </tr>




    <tr class="li_1">
        <%--<td align="right"><span class="color_red">*</span>
            项目报审级次：
            <br />
            （省补助资金拨付所属财政局）
        </td>
        <td>
            <c:set var="sub_step">{'id':'<x:out select="$xmlData/data/proposal/sub_step_value" />','name':'<x:out select="$xmlData/data/proposal/sub_step_name" />'}</c:set>
            <cpt:tree key="sub_step" cacheable="false" className="hn_iuput_kuang  " readonly="true" value="${sub_step}" label="项目报审级次" id="sub_step" onlyChooseLeaf="false" showPattern="all" shieldPattern="0"
                topCheckbox="true" onClick="initTreeValueExt" />
            <input id="sub_step_value" type="hidden" name="proposal/sub_step_value" class="required" label="项目报审级次" value="<x:out select="$xmlData/data/proposal/sub_step_value" />" />
            <input id="sub_step_name" type="hidden" name="proposal/sub_step_name" value="<x:out select="$xmlData/data/proposal/sub_step_name" />" />
        </td>--%>



        <td align="right"><span class="color_red">*</span>项目申请金额（万元）：</td>
        <td colspan="3">
            <input type="text" name="proposal/request_money" class="required" id="request_amount" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;"
                   value="<x:out select="$xmlData/data/proposal/request_money"/>" label="项目申请金额" onchange="synchronizationAmount()"
            >
        </td>
    </tr>

</table>
<input type="hidden" id="if_have_org" value="1" name="proposal/if_have_org "/>
<div class="t_bar"><span class="color_red">*</span>合作单位信息</div>
<table id="inland" border="0" cellspacing="0" cellpadding="0" style="width: 100%" class="table01 t_css">
    <thead>
    <tr>
        <th align="center" width="4%">选择</th>
        <th align="center" width="5%">序号</th>
        <th align="center" width="9%">单位名称</th>
        <th align="center" width="13%">单位地址</th>
        <th align="center" width="9%">合作单位性质</th>
        <th align="center" width="9%">合作形式</th>
        <th align="center" width="9%">合作经费支出（万元）</th>
        <th align="center" width="9%">联系人</th>
        <th align="center" width="9%">电话</th>
        <th align="center" width="12%">合作单位属地</th>
        <th align="center" width="12%">是否县域单位（不含市辖区）</th>
    </tr>
    </thead>
    <tbody id="inland_tab">
    <tr style="display: none" align="center">
        <td align="center">
            <input type="radio" class="radiobutton" name="selAttendOrg11">
        </td>
        <td align="center">
            <span name="inlands|inland[0]@seq_no">[index]</span>
        </td>
        <td align="center">
            <input name="inlands|inland[0]|org_name" label="单位名称" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|org_address" label="单位地址" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|coop_org_type" label="合作单位性质" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|coop_formal" label="合作形式" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|coop_fund_expend" label="合作经费支出" type="text" class="input_css required" style="width: 80%;text-align: right;" maxlength="100" value="" onfocus="InitInput.setNumber(this,9,2,2)"  />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|psn_name" label="联系人" type="text" required class="input_css required " maxlength="100" style="width: 80%;" value="" />
        </td>
        <td align="center">
            <input name="inlands|inland[0]|psn_phone" label="电话" type="text" required class="input_css required " maxlength="18" style="width: 80%;" value="" />
        </td>
        <td align="center">
            <cpt:select id="unit_territory[index]" key="unit_territory" name="unit_territory" onChange="initControlValue(this.id);setEffectivenesUnits()" value="" style="width:85%"></cpt:select>
            <input type="hidden" name="inlands|inland[0]|unit_territory_value" class="required" value=""  label="合作单位属地" />
            <input type="hidden" name="inlands|inland[0]|unit_territory_name" value=""/>
        </td>
        <td align="center">
            <cpt:select id="county_units[index]" key="no_yes" name="county_units" onChange="initControlValue(this.id);setEffectivenesUnits()" value="" style="width:85%"></cpt:select>
            <input type="hidden" name="inlands|inland[0]|county_units_value" class="required" value=""  label="是否县域单位" />
            <input type="hidden" name="inlands|inland[0]|county_units_name" value=""/>
        </td>

        <%--<td align="center">
        <cpt:checkbox key="no_yes" name="county_units"  width="70px"  repeatColumn="2" value="${county_units_value }"   tagType="radio" ></cpt:checkbox>
        <input type="hidden" name="inlands|inland[0]|county_units_value" class="required" value="" label="是否县域单位">
        <input type="hidden" name="inlands|inland[0]|county_units_name" value=""/>
        </td>--%>
        <%--
                    <td align="center">
                        <input type="radio" id="county_unitsA[index]" name="inlands|inland[0]|county_units" value="1"
                               class="do unlock" label="是" onclick="initControlValue(this.id);"/>是
                        <input type="radio" id="county_unitsB[index]" name="inlands|inland[0]|county_units" value="2"
                               class="do unlock" label="否" onclick="initControlValue(this.id);"/>否
                        <input type="hidden" name="inlands|inland[0]|county_units_value" label="是否县域单位" class="required"
                               id="county_units_value[index]"/>
                    </td>--%>

    </tr>
    <c:set value="0" var="index" scope="page" />
    <x:forEach select="$xmlData/data/inlands/inland" var="inland">

        <c:choose>
            <c:when test="${index<10}">
                <c:set value="0" var="flag" scope="page" />
            </c:when>
            <c:otherwise>
                <c:set value="" var="flag" scope="page" />
            </c:otherwise>
        </c:choose>
        <tr align="center">
            <td>
                <input type="radio" class="radiobutton" name="selAttendOrg11">
            </td>
            <td align="center">
					<span name="inlands/inland[${flag}${index}]@seq_no">
						<x:out select="$inland/@seq_no" />
					</span>
            </td>
            <td>
                <input name="inlands/inland[${flag}${index}]/org_name" label="单位名称" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/org_name" />" />
            </td>

            <td>
                <input name="inlands/inland[${flag}${index}]/org_address" label="单位地址" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/org_address" />" />
            </td>


            <td align="center">
                <input name="inlands/inland[${flag}${index}]/coop_org_type" label="合作单位性质" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/coop_org_type" />" />
            </td>

            <td align="center">
                <input name="inlands/inland[${flag}${index}]/coop_formal" label="合作形式" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/coop_formal" />" />
            </td>

            <td align="center">
                <input name="inlands/inland[${flag}${index}]/coop_fund_expend" label="合作经费支出" type="text" required class="input_css required" style="width: 80%;text-align: right;" maxlength="100" onfocus="InitInput.setNumber(this,9,2,2)"
                       value="<x:out select="$inland/coop_fund_expend" />" />
            </td>

            <td>
                <input name="inlands/inland[${flag}${index}]/psn_name" label="联系人" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/psn_name" />" />
            </td>
            <td>
                <input name="inlands/inland[${flag}${index}]/psn_phone" label="电话" type="text" required class="input_css  required maxlength:18" style="width: 80%;" maxlength="18"
                       value="<x:out select="$inland/psn_phone" />" />
            </td>

            <td>
                <c:set var="unit_territory"><x:out select="$inland/unit_territory_value" /></c:set>
                <cpt:select id="unit_territory${flag}${index}" key="unit_territory" name="unit_territory" onChange="initControlValue(this.id);setEffectivenesUnits();" value="${unit_territory }" style="width:85%"></cpt:select>
                <input type="hidden" name="inlands/inland[${flag}${index}]/unit_territory_value" class="required" value="<x:out select="$inland/unit_territory_value" />"  label="合作单位属地" />
                <input type="hidden" name="inlands/inland[${flag}${index}]/unit_territory_name" value="<x:out select="$inland/unit_territory_name" />"/>
            </td>
            <td>
                <c:set var="county_units"><x:out select="$inland/county_units_value" /></c:set>
                <cpt:select id="county_units${flag}${index}" key="no_yes" name="county_units" onChange="initControlValue(this.id);setEffectivenesUnits();" value="${county_units }" style="width:85%"></cpt:select>
                <input type="hidden" name="inlands/inland[${flag}${index}]/county_units_value" class="required" value="<x:out select="$inland/county_units_value" />"  label="是否县域单位" />
                <input type="hidden" name="inlands/inland[${flag}${index}]/county_units_name" value="<x:out select="$inland/county_units_name" />"/>
            </td>
                <%--<td align="center">
                    <input type="radio" id="county_unitsA[${flag}${index}]"
                           name="inlands/inland[${flag}${index}]/county_units" value="1" label="是" class="do unlock"
                           onclick="initControlValue(this.id);"/>是
                    <input type="radio" id="county_unitsB[${flag}${index}]"
                           name="inlands/inland[${flag}${index}]/county_units" value="2" label="否" class="do unlock"
                           onclick="initControlValue(this.id);"/>否
                    <input type="hidden" name="inlands/inland[${flag}${index}]/county_units_value" label="是否县域单位"
                           class="required" id="county_units_value${index}"
                           value="<x:out select="$inland/county_units_value"/>"/>
                    <input type="hidden" name="inlands/inland[${flag}${index}]/county_units_name" label="是否县域单位"
                           class="required" id="county_units_value${index}"
                           value="<x:out select="$inland/county_units_name"/>"/>
                </td>--%>
        </tr>
        <c:set var="beggerClass"></c:set>
        <c:set value="${index+1}" var="index" scope="page" />
    </x:forEach>
    </tbody>
</table>

<table width="98%" class="not_table">
    <tr>
        <td>
            <input class="button_02" type="button" name="cmdAddbefore" value="添加" onclick="if(checkTabLimit('inland',5,'合作单位信息最多只能填写5条')){addNewRow('inland');}try{top.resizeFrame();}catch(e){};setEffectivenesUnits()" />
            <input class="button_02" name="cmdMovePrev" type="button" value="上移" onclick="movePrev('inland');setEffectivenesUnits()" />
            <input class="button_02" name="cmdMoveNext" type="button" value="下移" onclick="moveNext('inland');setEffectivenesUnits()" />
            <input class="button_02" name="cmddel" type="button" value="删除" onclick="deleteSelectedRow('inland','合作单位信息');setEffectivenesUnits();" />
        </td>
    </tr>
</table>
<input type="hidden" name="proposal/effectivenes_units" id="effectivenes_units" value="<x:out select='$xmlData/data/proposal/effectivenes_units'/>"/>
<input type="hidden" id="age" name="proposal/attach_age" value="<x:out select="$xmlData/data/proposal/attach_age" />"/>

<div class="t_bar"><span class="color_red">*</span>项目简述（须准确说明项目对应的指南方向。限280字）</div>
<table id="tblMileStones0" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>

    <tr>
        <td colspan="4">
            <textarea name="project/summary0"  class="input_textarea required maxlength:280" label="项目简述" rows=5 style="width:98%"><x:out select="$xmlData/data/project/summary0" /></textarea>
            <input type="hidden" name="project/summary0_hidden" id="project/summary0_hidden" value="<x:out select="$xmlData/data/project/summary0" />"/>
        </td>
    </tr>
</table>

<script type="text/javascript">

    $(function(){
        emerging_enterprises();
        $("#tab1").click();
        $("#fragment-tab1 :text,#fragment-tab1 [type='date']").addClass("input_width");
        $("#fragment-tab1 select").addClass("select_width");
        /*$("table.t_css").each(function(){
            $(this).find("tr").not(".cbTable tr").filter(":even").addClass("li_1");
            $(this).find("tr").not(".cbTable tr").filter(":odd").addClass("li_2");
        });*/
    });

    $(document).ready(function(){
        compare_age();
        industrial_enterprise();
        if($('input:checkbox[name="enterprise_scale"]:checked').val()=="中小企业"){
            $("#technologyEnterprise").removeAttr("disabled");
        }else{
            $("#technologyEnterprise").attr("disabled",true);
        }
    });
    $("table").addClass("table01");
    $("#checkbox_table_").removeClass("table01");
    $("#feaReport_upload").removeClass("table01");
    $('div').find("[id^='checkbox_dyn_']").find("tr").removeClass("li_1").removeClass("li_2");
    $('div').find("[id^='checkbox_dyn_']").find("td").css("border",'0px solid');
    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }

    function localInitTreeValue(treeId, treeNode) {
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label")
                + messageTip.researchAreaInvalidDisciplineCode);
            return false;
        }
        var showName = "";
        var parentId="";
        if (obj != null) {
            str = obj.name + "-" + str;
            //obj = obj.parentNode;
            showName = obj.name;
            parentId=obj.id;
            $("#" + treeId).parents("tr").find("[name$='domain_value']").val(treeNode.id);
            $("#" + treeId).parents("tr").find("[name$='subject_no']").val(str.split("_")[1]);
            $("#" + treeId).parents("tr").find("[name$='domain_name']").text(treeNode.name.split("_")[0]);
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(parentId);
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(showName);
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val(str);
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val(treeNode.id);
        }else{
            $("#"+treeId).parents("tr").find("[name$='domain_value']").val("");
            $("#"+treeId).parents("tr").find("[name$='subject_no']").val("");
            $("#"+treeId).parents("tr").find("[name$='domain_name']").text("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
        }
        $("#" + treeId).val(str);
    }
    function setEmptyValueForTree(id){
        $("#"+id).parents("tr").find("[name$='domain_value']").val("");
        $("#"+id).parents("tr").find("[name$='subject_no']").val("");
        $("#"+id).parents("tr").find("[name$='domain_name']").text("");
        $("#" + id).parents("td").find("[name$='" + id + "_all_name'],[id$='" + id + "_all_name']").val("");
        $("#" + id).parents("td").find("[name$='" + id + "_all_value'],[id$='" + id + "_all_value']").val("");
        $("#"+id).val("");
        $("#"+id+"_hideId").val("");
        $("#"+id+"_hideName").val("");
        $("#"+id+"_code").val("");
        $("#"+id+"_value").val("");
        $("#"+id+"_name").val("");
        $("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
    }

    /*
    function initControlValue(objId){

            var name="";
            var obj=$("#"+objId);
            if(obj.is("select")){
                name=obj.attr("name");
                obj.parent().children("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).find("option:selected").val());
                $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).find("option:selected").text());
            }

            else if(obj.is(":radio")){
                name=obj.attr("name");
                if(obj.is(":checked")){//如果被选中
                    //alert($("#"+objId).val());
                    obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
                    $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).next().text());
                }
                else{

                    obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val("");
                }
            }else if(obj.is(":checkbox")){
                name=obj.attr("name");
                if(obj.is(":checked"))//如果被选中
                    obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
                else
                    obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val("");
            }else{
                name=obj.attr("id");
                obj.parents("td").find("input[name$='"+name+"_name'][type='hidden']").val(obj.val());
                obj.parents("td").find("input[name$='"+name+"_code'][type='hidden']").val($("#"+objId+"_hideId").val());
            }
        }
    */
    function synchronizationAmount(){
        var request_amount=$("#request_amount").val();
        if(request_amount !=  ""){
            $("#total_each_0").val(parseFloat($("#request_amount").val()).toFixed(2));
            countFundAuto('total_','each_0,each_1,each_2,each_4','investfrom_5');
        }else if(request_amount ==  ""){
            $("#total_each_0").val("");
            countFundAuto('total_','each_0,each_1,each_2,each_4','investfrom_5');
        }
    }

    function synchronizationAmount1(){
        var built_institute=$("#built_institute").val();
        if(built_institute != ""){
            $("span[id='built_institute_[00]']").html($("#built_institute").val());
            /*$("#total_fund_18").val(parseFloat($("#request_amount").val()).toFixed(2));*/
        }else{
            $("span[id='built_institute_[00]']").html("");
        }
    }
    function setEffectivenesUnits(){
        var effectivenes_units="";
        $("#inland tr:gt(1)").each(function(index){
            var effectivenes_unit = $(this).find("td:eq(9) input").val().trim();
            /*var orgName = $("#org_name").val().trim();*/
            var orgName = $('span[name$="inlands/inland/unit_territory_value"]').html()
            if(!isBlankOrNull(effectivenes_unit) && effectivenes_unit!=orgName){
                effectivenes_units += effectivenes_unit+",";
            }
        });
        if(effectivenes_units!=""){
            effectivenes_units=effectivenes_units.substring(0,effectivenes_units.length-1);
        }
        $("#effectivenes_units").val(effectivenes_units);
    }
    /***
     * 勾选中小型企业框时打开科技型中小企业选择
     * 没有勾选时关闭科技型中小企业选择，并清除隐藏域的值
     *
     */
    function removeDisabled(){
        if($('input:checkbox[name="enterprise_scale"]:checked').val()=="中小企业"){
            $("#technologyEnterprise").removeAttr("disabled");
        }else{
            $("#technologyEnterprise").removeAttr("checked");
            $("#technology_enterprise_value").val("");
            $("#technologyEnterprise").attr("disabled",true);
        }
    };
    function initTreeValueExt(treeId, treeNode) {
        if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
            if (treeNode.level == 0) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
            }
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            obj = obj.parentNode;
        }
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
    }
    function compare_age() {
        var end_date = $("#statYear").val();
        var birthday = $("#fzbirthday").val();

        var end_date_year = Number(end_date.substring(0,4));
        var birthday_year = Number(birthday.substring(0,4));

        /*var end_date_month = Number(end_date.substring(5,7));
        var birthday_month = Number(birthday.substring(5,7));

        var end_date_day = Number(end_date.substring(8));
        var birthday_day = Number(birthday.substring(8));*/

        var different_value = end_date_year - birthday_year -57;
        /*var different_value1 = end_date_month - birthday_month;
        var different_value2 = end_date_day - birthday_day;*/

        if(different_value > 0 ){
            $("#age").val(1);
        }else{
            $("#age").val(0);
        }
        //onchangeType2();

    }

    /*$("#industrial_enterprise_value").onchange(function(industrial_enterprise){
        var industrial_enterprise_value = $("#industrial_enterprise_value").val();
        if(industrial_enterprise_value==1){
            $("#industrial_value").val(1);
        }else{
            $("#industrial_value").val(0);
        }
    });*/

    function industrial_enterprise() {
        var industrial_enterprise_value = $("#industrial_enterprise_value").val();
        if(industrial_enterprise_value==0){
            $("#industrial_value").val(1);
        }else{
            $("#industrial_value").val(0);
        }

    }

    function emerging_enterprises() {
        var emerging_enterprises_value = $("#emerging_enterprises_value").val();
        if (emerging_enterprises_value == '0') {
            $("#emerging_industries_value_div").attr("style","display:block");
            $("#emerging_industries_value").addClass("required");
        } else {
            $("#emerging_industries_value_div").attr("style","display:none");
            $("input[name='proposal/emerging_industries_value']").val('');
            $("input[name='proposal/emerging_industries_name']").val('');
            $("#checkbox_dyn_emerging_industries").find("td input[type='checkbox']").attr("checked",false);
            $("#emerging_industries_value").removeClass("required");
        }
    }

    /**
     * 重新计算行号
     * @param tblId
     */
    function refreshRowINdex2(tblId){
        //重新计算行号


        $("#"+tblId+" tr").each(function(){

                var seq=$(this).get(0).rowIndex;//获得行数
                if(seq>1){//如果有行  显示时display行不计入类，故只减1

                    seq=seq-1;
                    var seq_no=$(this).find("[name$='seq_no']");
                    if(seq_no.is("span"))
                        seq_no.html(seq);
                    else
                        seq_no.val(seq);

                    seq=""+(seq-1);
                    if(seq.length==1)
                        seq="0"+seq;


                    //替换相应的name参数的seq
                    $(this).find("input,div,span,textarea,select,a,button").each(function(){

                        var name=$(this).attr("name");
                        if(name!=null&&name!=""){
                            var s_val = $(":hidden[name='"+name+"_value'] ").val();//查找radio对应的value值
                            name=name.replace(/\[\d*\]/g,"["+seq+"]");
                            $(this).attr("name",name);
                            var t_val = $(this).val();
                            if(s_val !=  undefined && s_val==t_val){
                                $(this).attr("checked",true); //给radio重新选择
                            }
                        }
                        var id=$(this).attr("id");
                        if(id!=null&&id!=""){
                            id=id.replace(/\[\d*\]/g,"["+seq+"]");
                            $(this).attr("id",id);
                            id=id.replace(/\d+/g,""+seq+"");
                            $(this).attr("id",id);
                            var onlickStr =  $(this).attr("onclick");
                            if(onlickStr != undefined && typeof(onlickStr) != undefined  && onlickStr!=null && (onlickStr.indexOf("show_") == 0 || onlickStr.indexOf("deleteFile") == 0)){
                                var str1 = onlickStr.substring(0,onlickStr.indexOf(","));
                                str1=str1.replace(/\d+/g,""+seq+"");
                                var str2 = onlickStr.substring(onlickStr.indexOf(",")+1,onlickStr.length);
                                if(str1 == undefined || str1 == ""){
                                    str2 = str2.replace(/\d+/g,""+seq+"");
                                    $(this).attr("onclick",str2);
                                }else{
                                    $(this).attr("onclick",str1+","+str2);
                                }
                            }

                        }
                        var className=$(this).attr("class");
                        if(className!=null&&className!=""){
                            className=className.replace(/\[\d*\]/g,"["+seq+"]");
                            $(this).attr("class",className);
                        }
                    });
                }
            }
        );

    }
    /**
     * 限制Table行数
     * @param tableId表格id
     * @param max最大行数
     * @returns {Boolean}
     */
    function checkTabLimit2(tableId,max,message)
    {
        var maxLinNum=$("#"+tableId+" tr").length-3;

        if(maxLinNum>=max)
        {
            scmWarn(message);
            return false;
        }
        return true;
    }
    /**
     * 删除一行
     * @param radioId
     */
    function deleteSelectedRow2(tableId,message,nummin,warnMsg,selName){
        if(!selName)selName="selMileStones";
        var tr=$("#"+tableId+" :radio[name*='"+selName+"']:checked").parents("tr");
        if(nummin==null)
            nummin=0;
        var length=tr.length;
        if(tr.length==0)
            tr=$("#"+tableId+" tr").filter(":first");
        else if(tr.length>1)
            tr=tr.first();

        if(tr.get(0).rowIndex-1==nummin){
            scmWarn(irisNotes.delWarn1);
            return false;
        }
        if(length==0){

            scmWarn(irisNotes.delWarn2);

            return false;
        }
        if(!confirm(messageTip.deleteTip+message+"？"))
            return false;
        tr.remove();
        refreshRowINdex2(tableId);
        return true;
    }
    /**
     * 上移行
     * @param tblId
     * @returns {Boolean}
     */
    function movePrev2(tblId,selName) {

        if (!selName)
            selName = "";
        if ($("#" + tblId + " :radio[name*='" + selName + "']:checked").length == 0) {
            scmWarn(irisNotes.prevWarn);
            return false;
        }
        if ($("#" + tblId + " tr").length <= 2)
            return false;
        var trChecked = $("#" + tblId + " :radio[name*='" + selName + "']:checked")
            .parents("tr").first();// 取得被选中的行
        var trPrev = trChecked.prev();// 取得上一行
        var index = trChecked.get(0).rowIndex;// 获得行号
        if (index <= 2) {// 如果是第一行
            scmWarn(irisNotes.tabelMoveWarn1);
            return false;
        }
        //trChecked.remove();
        trPrev.before(trChecked);
        trChecked.find(":radio[name*='" + selName + "']").attr("checked", 'true');
        refreshRowINdex2(tblId);
    }

    function moveNext2(tblId,selName) {
        if (!selName)
            selName = "";
        if ($("#" + tblId + " :radio[name*='" + selName + "']:checked").length == 0) {
            scmWarn(irisNotes.nextWarn);
            return false;
        }
        if ($("#" + tblId + " tr").length <= 2) {
            return false;
        }
        var trChecked = $("#" + tblId + " :radio[name*='" + selName + "']:checked")
            .parents("tr").first();// 取得被选中的行
        var trNext = trChecked.next();
        var index = trChecked.get(0).rowIndex;// 获得行号
        if (index == $("#" + tblId + " tr").length - 2) {// 如果是第一行
            scmWarn(irisNotes.tabelMoveWarn2);
            return false;
        }
        //trChecked.remove();
        trNext.after(trChecked);
        trChecked.find(":radio[name*='" + selName + "']").attr("checked", "true");
        refreshRowINdex2(tblId);
    }

    function addNewRow2(tableId,url,title)
    {
        if(url!=null&&url!=""){
            showThickBox(url,title);

        }//跳转页面
        else
            addNewRowDeal2($("#"+tableId));
    }
    function addNewRowDeal2(table)
    {
        var tbid = table.attr("id");
        var maxLinNum=table.find("tr").length-3;;//获得行数，减去表头和隐藏行
        var lineNum=""+(maxLinNum+1);
        var sl = sLine[tbid];
        if(sl == undefined){
            sLine[tbid] = 1;
            sl = sLine[tbid];
        }else{
            sLine[tbid] ++;
            sl = sLine[tbid];
        }
        var tlineNum = "";

        var addHtml=table.find("tr")[1].innerHTML;//获得隐藏行的html,查找第二行
        addHtml=addHtml.replace(/\[index\]/g,lineNum);
        lineNum = (parseInt(lineNum, 10)-1).toString();//2011.12.13 行下标比行号小1(隐藏行下标[0]，第一行下标[00])
        if (lineNum.length==1){//如果是个位数，前面补0
            lineNum="0"+lineNum;
        }
        addHtml=addHtml.replace(/\[0\]/g,"["+lineNum+"]");//替换html中行号
        addHtml=addHtml.replace(/\|/g,"/");//替换html中节点/的代替符"|"
        table.append("<tr>"+addHtml+"</tr>");//将html增加到最后
        if(table.attr("id")!="tblnotice"){  //临时应急处理，20141211 cs   发布通知公告不兼容以下代码
            table.find("tr:last").find("input,div,span,textarea,select,button,a").each(function(){
                var id=$(this).attr("id");
                var onclick = $(this).attr("onclick");
                if(id!=null&&id!=""){
                    id = id.replace(/\[\d+\]/g, sl);
                    $(this).attr("id",id);
                }
                if(onclick!=null&&onclick!=""){
                    onclick = onclick.replace(/\[\d+\]/g, sl);
                    $(this).attr("onclick",onclick);
                }
                var classs=$(this).attr("class");
                if(classs!=null&&classs!=""){
                    classs = classs.replace(/\[\d+\]/g, sl);
                    $(this).attr("class",classs);
                }
            });
        }
    }
</script>
